package com.dreamspark.game.travian
{
	import com.dreamspark.game.travian.controller.AppConstants;
	import com.dreamspark.game.travian.controller.command.startup.StartupCommand;
	
	import org.puremvc.as3.patterns.facade.Facade;
	
	public class ApplicationFacade extends Facade
	{
		public function ApplicationFacade()
		{
			super();
		}
		
		/**
		 * The singleton instance factory method.
		 */
		public static function getInstance( ) : ApplicationFacade 
		{
			if ( instance == null ) instance = new ApplicationFacade( );
			return instance as ApplicationFacade;
		}
		
		/**
		 * A convenience method for starting up the PureMVC 
		 * apparatus from the application.
		 */
		public function startup( app:Travian ):void
		{
			registerCommand( AppConstants.STARTUP, StartupCommand );
			sendNotification( AppConstants.STARTUP, app );
		}
	}
}